package com.enthusiasm.frame;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

import com.waps.AppConnect;
import com.young.R;

public class GameQuitActivity extends Activity{
	private ImageView sure;
	private ImageView cancel;
	private ImageView imgbg;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.quit);
		imgbg = (ImageView) findViewById(R.id.imgbg);
		sure = (ImageView) findViewById(R.id.quit_sure);
		cancel = (ImageView) findViewById(R.id.quit_cancel);
		sure.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				AppConnect.getInstance(GameQuitActivity.this).finalize();//广告退出
				 Intent intent = new Intent();
				 setResult(1, intent);
				 finish();
			}
		});
		cancel.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				GameQuitActivity.this.finish();
			}
		});
//		RelativeLayout.LayoutParams relative = new RelativeLayout.LayoutParams(
//				ViewGroup.LayoutParams.WRAP_CONTENT,
//				ViewGroup.LayoutParams.WRAP_CONTENT);
//		relative.width = Constants.WIDTH*3/5;
//		relative.addRule(RelativeLayout.CENTER_IN_PARENT);
//		imgbg.setLayoutParams(relative);
//		LinearLayout.LayoutParams linear = new LinearLayout.LayoutParams(
//				ViewGroup.LayoutParams.WRAP_CONTENT,
//				ViewGroup.LayoutParams.WRAP_CONTENT);
//		linear.leftMargin = Constants.WIDTH/10;
//		linear.rightMargin = Constants.WIDTH/10;
//		sure.setLayoutParams(linear);
//		cancel.setLayoutParams(linear);
	}
}
